Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Accessing and Changing Control Settings and Data /


SetControlVisibility

NEW WITH THE APPEARANCE MANAGER

Sets the visibility of a control, and any embedded controls, and specifies whether it will be drawn.

pascal OSErr SetControlVisibility (
                     ControlHandle inControl,
                     Boolean inIsVisible,
                     Boolean inDoDraw);
inControl
On input, a handle to the control.
inIsVisible
A Boolean value indicating whether the control is visible or invisible. If this value is set to true, the control will be visible. If false, the control will be invisible. If you wish to show a control (and latent embedded subcontrols) but do not want to cause screen drawing, pass true for this parameter and false in the inDoDraw parameter.
inDoDraw
On input, Boolean value indicating whether the control should be drawn or erased. If true, the control's display on the screen should be updated (drawn or erased) based on the value passed in the inIsVisible parameter. If false, the display will not be updated.
function result
A result code; see "Result Codes".
DISCUSSION
You should call the SetControlVisibility function instead of setting the contrlVis field of the control structure to set the visibility of a control and specify whether it will be drawn. If the control has embedded controls, SetControlVisibility allows you to set their visibility and specify whether or not they will be drawn. If you wish to show a control but do not want it to be drawn onscreen, pass true in the inIsVisible parameter and false in the inDoDraw parameter.

SEE ALSO
"Appearance Manager Gestalt Selector Constants".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998